package com.fastjars.business.upload;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * ActionResult
 *
 * @author Brant Liu <br> 邮箱：<br>lbf1988@qq.com <br>日期：<br>2018/04/16
 * @version 1.0.0
 */
public class ActionResult implements Serializable {
    private int action;
    private String state;
    private String original;
    private String name;
    private String url;
    private String size;
    private String type;
    private String source;
    private String rootPath;
    private long start;
    private long total;
    private List<ActionResult> list;

    public ActionResult(int actionState) {
        this.state = ActionState.getStateInfo(actionState);
    }

    public ActionResult(int action, int actionState) {
        this.action = action;
        this.state = ActionState.getStateInfo(actionState);
    }

    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }

    public String getOriginal() {
        return original;
    }

    public void setOriginal(String original) {
        this.original = original;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getSize() {
        return size;
    }

    public void setSize(String size) {
        this.size = size;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public int getAction() {
        return action;
    }

    public void setAction(int action) {
        this.action = action;
    }

    public String getSource() {
        return source;
    }

    public void setSource(String source) {
        this.source = source;
    }

    public List<ActionResult> getList() {
        return list;
    }

    public void setList(List<ActionResult> list) {
        this.list = list;
    }

    public void addItem(ActionResult item){
        if(null == this.list){
            this.list = new ArrayList<>();
        }
        this.list.add(item);
    }

    public String getRootPath() {
        return rootPath;
    }

    public void setRootPath(String rootPath) {
        this.rootPath = rootPath;
    }

    public long getStart() {
        return start;
    }

    public void setStart(long start) {
        this.start = start;
    }

    public long getTotal() {
        return total;
    }

    public void setTotal(long total) {
        this.total = total;
    }
}
